<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
	<div class="t_bar">
		<span class="color_red">*</span>创新研究机构建设计划及资金安排
	</div>
	<table cellpadding="0" id="tblInvestmented" class="t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
		<tr style="border:1px solid #B7D1E6">
			<td colspan="4">
				在项目执行期内，每一阶段应达到的具体目标，包括时间进度指标、技术指标、资金使用计划等，应列明资金资助拟购置的设备、仪器、软件等。
				每一阶段目标应是比较详细的、可进行考核的定性定量描述，将供项目监察、验收之用。
			</td>
		</tr>
		<tr>
			<td width="180px">
				<strong>（一）创新研究机构组建计划总投入</strong>
			</td>
			<td colspan="3" width="860px">
				<input name="innovation_org/milestone/total_investment" onfocus="InitInput.setNumber(this,7,4,2)" label="创新研究机构组建计划总投入" 
			type="text" required class="required input_css "   style="text-align:right; width:150px;" id="total_investment"
			 maxlength="50" value="<x:out select="$xmlData/data/innovation_org/milestone/total_investment" />"/>&nbsp;万元
			</td>
		</tr>
		<tr>
			<td >
				<strong>（二）已完成投入</strong>
			</td>
			<td colspan="3" width="860px">
				<input name="innovation_org/milestone/investmented/total_costs" onfocus="InitInput.setNumber(this,7,4,2)" label="已完成投入" 
			type="text" required class="required gray input_css valueGreatEqual:total_investment:investmented_costs_0" disabled  style="text-align:right; width:150px;" id="investmented_costs_0"
			 maxlength="50" value="<x:out select="$xmlData/data/innovation_org/milestone/investmented/total_costs" />"/>&nbsp;万元
			</td>
			
		</tr>
		<tr>
			<td align="right">
				其中人员费：
			</td>
			<td nowrap>
				<input name="innovation_org/milestone/investmented/personnel_costs" onfocus="InitInput.setNumber(this,7,4,2)" label="已完成投入中人员费" 
			type="text" required class="required input_css "  id="investmented_costs_1" onchange="countFund('investmented_costs_','1,2,3','0');"   style="text-align:right; width:150px;"
			 maxlength="50" value="<x:out select="$xmlData/data/innovation_org/milestone/investmented/personnel_costs" />"/>&nbsp;万元
			</td>
			
			<td width="157px" align="right">
				其他费用：
			</td>
			<td>
				<input name="innovation_org/milestone/investmented/other_costs" onfocus="InitInput.setNumber(this,7,4,2)" label="已完成投入中其他费用" 
			type="text" required class="required input_css "   style="text-align:right; width:150px;"   id="investmented_costs_2" onchange="countFund('investmented_costs_','1,2,3','0');" 
			 maxlength="50" value="<x:out select="$xmlData/data/innovation_org/milestone/investmented/other_costs" />"/>&nbsp;万元
			</td>
		</tr>
		<tr>
			<td  align="right">
				其中仪器设备费：
			</td>
			<td colspan="3">
			
			<input id="investmented_equipments" label="xml" type="hidden" name="innovation_org/milestone/investmented/equipments" value="<x:out select="$xmlData/data/innovation_org/milestone/investmented/equipments" />"/>
			<input name="milestone/investmented/equipments/total_costs" onfocus="InitInput.setNumber(this,7,4,2)" label="已完成投入中仪器设备费" 
			type="text" required class="gray required input_css " disabled style="text-align:right; width:150px;"   id="investmented_costs_3" onchange="countFund('investmented_costs_','1,2,3','0');" 
			onclick="countFund('investmented_costs_','1,2,3','0');"
			 maxlength="50" value="<x:out select="$xmlData/data/milestone/investmented/equipments/total_costs" />"/>&nbsp;万元
			 
			 
			&nbsp;&nbsp;&nbsp;<a href="#" onclick="editEquipments('${ctx}/proposal/edit/dialog/prpMilestonesEquipmentsEdit_cxzj?parentTab=tblInvestmented&type=investmented&needMeetingInfo=${param.needMeetingInfo}&TB_iframe=true&height=440&width=750','编辑设备详情')"><font color="blue">编辑设备详情</font></a>
			
			</td>
		</tr>
	</table>
	
	<table id="tbl_new_investment" cellpadding="0" class="t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
		
		</tr>
		<tr>
			<td width="180px" nowrap>
				<strong>（三）新增投入</strong>
			</td>
			<td width="300px">
				<input name="innovation_org/milestone/new_investment/total_costs" id="total_costs" onfocus="InitInput.setNumber(this,7,4,2)" label="新增投入" 
			type="text" required class="required input_css valueGreatEqual:total_investment:total_costs"   style="text-align:right; width:150px;"
			 maxlength="50" value="<x:out select="$xmlData/data/innovation_org/milestone/new_investment/total_costs" />"/>&nbsp;万元
			</td>
			<td width="150px" align="right">
				其中申请政府资助：
			</td>
			<td>
				<input id="total_funds" name="innovation_org/milestone/new_investment/government_funded/total_costs" onfocus="InitInput.setNumber(this,7,4,2)" label="新增投入中申请政府资助" 
			type="text" required class="required input_css valueGreatEqual:total_costs:total_funds"   style="text-align:right; width:150px;"
			 maxlength="50" value="<x:out select="$xmlData/data/innovation_org/milestone/new_investment/government_funded/total_costs" />"/>&nbsp;万元
			</td>
		</tr>
		<tr>
			<td colspan="4">
				<strong>政府资助资金开支预算计划</strong>
			</td>
		</tr>
		<tr>
			<td width="150px" align="right">
				其中人员费：
			</td>
			<td>
				<input name="innovation_org/milestone/new_investment/government_funded/personnel_costs" onfocus="InitInput.setNumber(this,7,4,2)" label="新增投入中人员费" 
			type="text" required class="required input_css "   style="text-align:right; width:150px;"
			 maxlength="50" value="<x:out select="$xmlData/data/innovation_org/milestone/new_investment/government_funded/personnel_costs" />"/>&nbsp;万元
			</td>
			<td width="150px" align="right">
				其他费用：
			</td>
			<td >
				<input name="innovation_org/milestone/new_investment/government_funded/other_costs" onfocus="InitInput.setNumber(this,7,4,2)" label="新增投入中其他费用" 
			type="text" required class="required input_css "   style="text-align:right; width:150px;"
			 maxlength="50" value="<x:out select="$xmlData/data/innovation_org/milestone/new_investment/government_funded/other_costs" />"/>&nbsp;万元
			</td>
		</tr>
		<tr>
			<td width="150px" align="right">
				其中仪器设备费：
			</td>
			<td colspan="3">
			<input type="hidden" id="new_investment_equipments"  label="xml"  name="innovation_org/milestone/new_investment/equipments" value="<x:out select="$xmlData/data/innovation_org/milestone/new_investment/equipments" />"/>
			<input name="milestone/new_investment/equipments/total_costs" onfocus="InitInput.setNumber(this,7,4,2)" label="新增投入中仪器设备费" 
			type="text" required class="gray required input_css "   disabled id="new_equipments_costs_0"  style="text-align:right; width:150px;"
			 maxlength="50" value="<x:out select="$xmlData/data/milestone/new_investment/equipments/total_costs" />"/>&nbsp;万元
		
			&nbsp;&nbsp;&nbsp;<a href="#" onclick="editEquipments('${ctx}/proposal/edit/dialog/prpMilestonesEquipmentsEdit_cxzj?parentTab=tbl_new_investment&type=new_investment&needMeetingInfo=${param.needMeetingInfo}&TB_iframe=true&height=440&width=750','编辑设备详情')"><font color="blue">编辑设备详情</font></a>
			
			</td>
			
		</tr>
	</table>
	
					
<textarea id="xmlStr1" style="display: none" >${param.xmlstr}</textarea>

<script type="text/javascript">
	function editEquipments(url,title)
	{
		if(url!=null&&url!=""){
			showThickBox(url,title);	
		}
	}
	
	$(function(){
		$("#investmented_costs_3").change(function(){
			countFund('investmented_costs_','1,2,3','0');
		});
		//将申请书xml中的研究领域xml字符串设置到每个设备的对应隐藏域
		setEquipment1("tblInvestmented", "xmlStr1");
		
	});
	
	function setEquipment1(tblId, xmlId){
		var xmlStr = $.trim($("#"+xmlId).val());
		//alert(xmlStr);
		if(xmlStr==null || xmlStr=="")
			return false;
		var reg = /[\r\n]/g;
		xmlStr=xmlStr.replace(reg,""); 
		
		var milestoneNode = /<milestone(.\n?)+?<\/milestone>/g;
		var milestone = xmlStr.match(milestoneNode);
		if(milestone==null || milestone=="")
			return false;
		
		var investmented = milestone[0].match(/<investmented(.\n?)+?<\/investmented>/g);
		if(investmented[0]!=null){
			var equipments = investmented[0].match(/<equipments(.\n?)+?<\/equipments>/);
			
			if(equipments!=null){
				var str = equipments[0].replace(/<equipments.*?>|<\/equipments>/g,"");
				$("#investmented_equipments").val(""+str+"");
			}
		} 
		
		var new_investment = milestone[0].match(/<new_investment(.\n?)+?<\/new_investment>/g);
		
		if(new_investment[0]!=null){
			var equipments = new_investment[0].match(/<equipments(.\n?)+?<\/equipments>/);
			
			if(equipments!=null){
				var str = equipments[0].replace(/<equipments.*?>|<\/equipments>/g,"");
				//$("#investmented_equipments").val('');
				$("#new_investment_equipments").val(""+str+"");
			}
		} 
	}
</script>